import { createRouter, createWebHistory } from 'vue-router'
import { staticRoutes } from '@router/route'



const router = createRouter({
  history: createWebHistory(location.pathname.split('/')[1]),
  routes: staticRoutes,
  //scrollBehavior
})



export default router


// scrollBehavior (to:any, fromto:any, savedPositionto:any) {//使用keep-alive标签后部分安卓机返回缓存页位置不精确问题
  //     if (savedPositionto) {
  //       return savedPositionto
  //   } else {
  //     if (fromto.meta.keepAlive) {
  //       fromto.meta.savedPosition = document.body.scrollTop;
  //     }
  //       return { x: 0, y: to.meta.savedPosition || 0 }
  //   }
  // }